import React, {Component} from 'react';
import {View, Text, StyleSheet, SafeAreaView, TouchableOpacity} from 'react-native';
import Colors from 'react-native/Libraries/NewAppScreen/components/Colors';
import StorageServer from '../../storage/Storage';
const styles = StyleSheet.create({
    title: {
        height: 50,
        paddingLeft: 10,
        paddingRight: 10,
        flexDirection: 'row',
        alignItems: 'center',
        backgroundColor: 'skyblue',
        shadowColor: '#000',  //设置阴影色
        shadowOffset:{width:0,height:10},  //设置阴影偏移,该值会设置整个阴影的偏移，width可以看做x,height可以看做y,x向右为正，y向下为正
        shadowOpacity: 1,
        elevation:2,
        justifyContent: 'space-between',
        shadowRadius: 1.5
    },
    titleText: {
        fontSize: 20,
        color: Colors.white,
        fontWeight: 'bold'
    },
    titleLogout:{
        fontSize: 18,
        color: Colors.white
    },
    container: {
        flex: 1
    }
});
class MinePage extends Component{
    _onPressButton = ()=>{
        StorageServer.clearAllData().then(()=>{});
        this.props.navigation.navigate('login');
    }
    render() {
        return (
            <SafeAreaView style={styles.container}>
                <View style={styles.title}>
                    <Text style={styles.titleText}>我的</Text>
                    <TouchableOpacity onPress={this._onPressButton}>
                        <Text style={styles.titleLogout}>退出</Text>

                    </TouchableOpacity>
                </View>
                <View>
                    <Text>redux的信息：</Text>
                </View>
                <View>
                    <Text>{this.props.isLogin}</Text>
                </View>
            </SafeAreaView>
        );
    }
}
export default MinePage;
